/******************************************************************************
 Copyright (c) 2021-2025 Qualcomm Technologies International, Ltd.
 All Rights Reserved.
 Qualcomm Technologies International, Ltd. Confidential and Proprietary.

******************************************************************************/

#include "gatt_battery_server_private.h"
#include "gatt_battery_server_access.h"
#include "gatt_battery_server.h"

/****************************************************************************/
bool GattBatteryServerReadLevelResponse(const GBASS *battery_server, uint32 cid, uint8 battery_level)
{
    uint16 status = CSR_BT_GATT_ACCESS_RES_READ_NOT_PERMITTED;

    if (battery_server == NULL)
    {
        return FALSE;
    }

    if (battery_level <= 100)
    {
        status = CSR_BT_GATT_ACCESS_RES_SUCCESS;
    }
    else
    {
        status = CSR_BT_GATT_ACCESS_RES_INSUFFICIENT_RESOURCES;
    }
    sendBatteryLevelAccessRsp(battery_server, cid, battery_level, status);
    return TRUE;
}

/****************************************************************************/
bool GattBatteryServerReadClientConfigResponse(const GBASS* battery_server, uint32 cid, uint16 client_config)
{
    if (battery_server == NULL)
    {
        return FALSE;
    }
#ifdef EXCLUDE_GATT_BATTERY_SERVICE_V1P1
    sendBatteryConfigAccessRsp(battery_server, cid, client_config);
#else
    sendBatteryConfigAccessRsp(battery_server, cid, GATT_BATTERY_SERVER_READ_CLIENT_CONFIG_IND, client_config);
#endif

    return TRUE;
}

/****************************************************************************/
bool GattBatteryServerReadPresentationResponse(const GBASS* battery_server, uint32 cid, uint8 name_space, uint16 description)
{
    if (battery_server == NULL)
    {
        return FALSE;
    }
#ifdef EXCLUDE_GATT_BATTERY_SERVICE_V1P1
    sendBatteryPresentationAccessRsp(battery_server, cid, name_space, description);
#else
    sendBatteryPresentationAccessRsp(battery_server, cid, GATT_BATTERY_SERVER_READ_PRESENTATION_IND, name_space, description);
#endif

    return TRUE;
}


#ifndef EXCLUDE_GATT_BATTERY_SERVICE_V1P1

/****************************************************************************/
bool GattBatteryServerReadBatteryLevelStatusResponse(const GBASS* batteryServer, uint32 cid, GattBatteryLevelStatus batteryLevelStatus)
{
    uint16 status = CSR_BT_GATT_ACCESS_RES_READ_NOT_PERMITTED;
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    if (batteryLevelStatus.flags < 8)
    {
        status = CSR_BT_GATT_ACCESS_RES_SUCCESS;
    }
    else
    {
        status = CSR_BT_GATT_ACCESS_RES_INSUFFICIENT_RESOURCES;
    }
    sendBatteryLevelStatusAccessRsp(batteryServer, cid, batteryLevelStatus, status);
    return TRUE;
}

bool GattBatteryServerBatteryLevelStatusClientConfigResponse(const GBASS* batteryServer, uint32 cid, uint16 clientConfig)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryConfigAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_BATTERY_LEVEL_STATUS_CLIENT_CONFIG_IND, clientConfig);
    return TRUE;
}

bool GattBatteryServerBatteryLevelStatusServerConfigResponse(const GBASS* batteryServer, uint32 cid, uint16 serverConfig)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryConfigAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_BATTERY_LEVEL_STATUS_SERVER_CONFIG_IND, serverConfig);
    return TRUE;
}

/******************************************************************************/
bool GattBatteryServerReadEstimatedServiceDateResponse(const GBASS* batteryServer, uint32 cid, uint32 estimatedDate)
{
    uint16 status = CSR_BT_GATT_ACCESS_RES_READ_NOT_PERMITTED;
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    status = CSR_BT_GATT_ACCESS_RES_SUCCESS;
    sendBatteryEstimatedServiceDateAccessRsp(batteryServer, cid, estimatedDate, status);
    return TRUE;
}

bool GattBatteryServerEstimatedServiceDateClientConfigResponse(const GBASS* batteryServer, uint32 cid, uint16 clientConfig)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryConfigAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_ESTIMATED_SERVICE_DATE_CLIENT_CONFIG_IND, clientConfig);
    return TRUE;
}

bool GattBatteryServerReadEstimatedServiceDatePresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_ESTIMATED_SERVICE_DATE_PRESENTATION_IND, nameSpace, description);
    return TRUE;
}

/****************************************************************************/
bool GattBatteryServerReadBatteryCriticalStatusResponse(const GBASS* batteryServer, uint32 cid, uint8 batteryCriticalStatus)
{
    uint16 status = CSR_BT_GATT_ACCESS_RES_READ_NOT_PERMITTED;

    if (batteryServer == NULL)
    {
        return FALSE;
    }
    if (batteryCriticalStatus < 4)
    {
        status = CSR_BT_GATT_ACCESS_RES_SUCCESS;
    }
    else
    {
        status = CSR_BT_GATT_ACCESS_RES_INSUFFICIENT_RESOURCES;
    }
    sendBatteryCriticalStatusAccessRsp(batteryServer, cid, batteryCriticalStatus, status);

    return TRUE;
}

bool GattBatteryServerBatteryCriticalStatusClientConfigResponse(const GBASS* batteryServer, uint32 cid, uint16 clientConfig)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryConfigAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_BATTERY_CRITICAL_STATUS_CLIENT_CONFIG_IND, clientConfig);
    return TRUE;
}

/****************************************************************************/
bool GattBatteryServerReadBatteryEnergyStatusResponse(const GBASS* batteryServer, uint32 cid, GattBatteryEnergyStatus batteryEnergyStatus)
{
    uint16 status = CSR_BT_GATT_ACCESS_RES_READ_NOT_PERMITTED;
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    if (batteryEnergyStatus.flags < 64)
    {
        status = CSR_BT_GATT_ACCESS_RES_SUCCESS;
    }
    else
    {
        status = CSR_BT_GATT_ACCESS_RES_INSUFFICIENT_RESOURCES;
    }
    sendBatteryEnergyStatusAccessRsp(batteryServer, cid, batteryEnergyStatus, status);
    return TRUE;
}

bool GattBatteryServerBatteryEnergyStatusClientConfigResponse(const GBASS* batteryServer, uint32 cid, uint16 clientConfig)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryConfigAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_BATTERY_ENERGY_STATUS_CLIENT_CONFIG_IND, clientConfig);
    return TRUE;
}

bool GattBatteryServerReadExternalSourcePowerPresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_EXTERNAL_SOURCE_POWER_PRESENTATION_IND, nameSpace, description);    return TRUE;
}

bool GattBatteryServerReadPresentVoltagePresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_PRESENT_VOLTAGE_PRESENTATION_IND, nameSpace, description);
    return TRUE;
}

bool GattBatteryServerReadAvailableEnergyPresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_AVAILABLE_ENERGY_PRESENTATION_IND, nameSpace, description); 
    return TRUE;
}

bool GattBatteryServerReadAvailableBatteryCapacityPresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_AVAILABLE_BATTERY_CAPACITY_PRESENTATION_IND, nameSpace, description);
    return TRUE;
}

bool GattBatteryServerReadChargeRatePresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_CHARGE_RATE_PRESENTATION_IND, nameSpace, description);
    return TRUE;
}

bool GattBatteryServerReadAvailableEnergyAtLastChargePresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_AVAILABLE_ENERGY_AT_LAST_CHARGE_PRESENTATION_IND, nameSpace, description);
    return TRUE;
}

/****************************************************************************/
bool GattBatteryServerReadBatteryTimeStatusResponse(const GBASS* batteryServer, uint32 cid, GattBatteryTimeStatus currentBatteryTimeStatus)
{
    uint16 status = CSR_BT_GATT_ACCESS_RES_READ_NOT_PERMITTED;

    if (batteryServer == NULL)
    {
        return FALSE;
    }

    else
    {
        status = CSR_BT_GATT_ACCESS_RES_SUCCESS;
    }
    sendBatteryTimeStatusAccessRsp(batteryServer, cid, currentBatteryTimeStatus, status);

    return TRUE;
}

bool GattBatteryServerReadBatteryTimeStatusClientConfigResponse(const GBASS* batteryServer, uint32 cid, uint16 clientConfig)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryConfigAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_BATTERY_TIME_STATUS_CLIENT_CONFIG_IND, clientConfig);
    return TRUE;
}

bool GattBatteryServerReadBatteryTimeStatusPresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_BATTERY_TIME_STATUS_PRESENTATION_IND, nameSpace, description);
    return TRUE;
}

/****************************************************************************/
bool GattBatteryServerReadBatteryHealthStatusResponse(const GBASS* batteryServer, uint32 cid, GattBatteryHealthStatus batteryHealthStatus)
{
    uint16 status = CSR_BT_GATT_ACCESS_RES_READ_NOT_PERMITTED;

    if (batteryServer == NULL)
    {
        return FALSE;
    }

    if ((batteryHealthStatus.batteryHealthSummary <= 100) &&
        (batteryHealthStatus.currentTemperature <= 126 && batteryHealthStatus.currentTemperature >= -127))
    {
        status = CSR_BT_GATT_ACCESS_RES_SUCCESS;
    }
    else
    {
        status = CSR_BT_GATT_ACCESS_RES_INSUFFICIENT_RESOURCES;
    }
    sendBatteryHealthStatusAccessRsp(batteryServer, cid, batteryHealthStatus, status);

    return TRUE;
}

bool GattBatteryServerReadBatteryHealthStatusClientConfigResponse(const GBASS* batteryServer, uint32 cid, uint16 clientConfig)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryConfigAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_BATTERY_HEALTH_STATUS_CLIENT_CONFIG_IND, clientConfig);
    return TRUE;
}

bool GattBatteryServerReadBatteryHealthSummaryPresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_BATTERY_HEALTH_SUMMARY_PRESENTATION_IND, nameSpace, description);
    return TRUE;
}

bool GattBatteryServerReadCurrentTemperaturePresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_CURRENT_TEMPERATURE_PRESENTATION_IND, nameSpace, description);
    return TRUE;
}

/****************************************************************************/
bool GattBatteryServerReadBatteryHealthInformationResponse(const GBASS* batteryServer, uint32 cid, GattBatteryHealthInformation batteryHealthInformation)
{
    uint16 status = CSR_BT_GATT_ACCESS_RES_READ_NOT_PERMITTED;

    if (batteryServer == NULL)
    {
        return FALSE;
    }

    if ((batteryHealthInformation.minDesignedOperatingTemperature <= 126 && batteryHealthInformation.minDesignedOperatingTemperature >= -127) &&
        (batteryHealthInformation.maxDesignedOperatingTemperature <= 126 && batteryHealthInformation.maxDesignedOperatingTemperature >= -127) &&
        (batteryHealthInformation.minDesignedOperatingTemperature < batteryHealthInformation.maxDesignedOperatingTemperature))
    {
        status = CSR_BT_GATT_ACCESS_RES_SUCCESS;
    }
    else
    {
        status = CSR_BT_GATT_ACCESS_RES_INSUFFICIENT_RESOURCES;
    }
    sendBatteryHealthInformationAccessRsp(batteryServer, cid, batteryHealthInformation, status);

    return TRUE;
}

bool GattBatteryServerReadBatteryHealthInformationClientConfigResponse(const GBASS* batteryServer, uint32 cid, uint16 clientConfig)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryConfigAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_BATTERY_HEALTH_INFORMATION_CLIENT_CONFIG_IND, clientConfig);
    return TRUE;
}

bool GattBatteryServerReadMinDesignedOperatingTemperaturePresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_MIN_DESIGNED_OPERATING_TEMPERATURE_PRESENTATION_IND, nameSpace, description);
    return TRUE;
}

bool GattBatteryServerReadMaxDesignedOperatingTemperaturePresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_MAX_DESIGNED_OPERATING_TEMPERATURE_PRESENTATION_IND, nameSpace, description);
    return TRUE;
}

/****************************************************************************/
bool GattBatteryServerReadBatteryInformationResponse(const GBASS* batteryServer, uint32 cid, GattBatteryInformation batteryInformation)
{
    uint16 status = CSR_BT_GATT_ACCESS_RES_READ_NOT_PERMITTED;

    if (batteryServer == NULL)
    {
        return FALSE;
    }

    if ((batteryInformation.batteryManufactureDate >= 1 && batteryInformation.batteryManufactureDate <= 16777214) &&
        (batteryInformation.batteryExpirationDate >= 1 && batteryInformation.batteryExpirationDate <= 16777214) &&
        (batteryInformation.batteryManufactureDate < batteryInformation.batteryExpirationDate) &&
        (batteryInformation.batteryDesignedCapacity > 0) &&
        (batteryInformation.batteryLowEnergy > 0) &&
        (batteryInformation.batteryCriticalEnergy > 0) &&
        (batteryInformation.nominalVoltage > 0) &&
        (batteryInformation.batteryAggregationGroup >= 1))
    {
        status = CSR_BT_GATT_ACCESS_RES_SUCCESS;
    }
    else
    {
        status = CSR_BT_GATT_ACCESS_RES_INSUFFICIENT_RESOURCES;
    }
    sendBatteryInformationAccessRsp(batteryServer, cid, batteryInformation, status);

    return TRUE;
}

bool GattBatteryServerReadBatteryInformationClientConfigResponse(const GBASS* batteryServer, uint32 cid, uint16 clientConfig)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryConfigAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_BATTERY_INFORMATION_CLIENT_CONFIG_IND, clientConfig);
    return TRUE;
}

bool GattBatteryServerReadBatteryManufactureDatePresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_BATTERY_MANUFACTURE_DATE_PRESENTATION_IND, nameSpace, description);
    return TRUE;
}

bool GattBatteryServerReadBatteryExpirationDatePresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_BATTERY_EXPIRATION_DATE_PRESENTATION_IND, nameSpace, description);
    return TRUE;
}

bool GattBatteryServerReadBatteryDesignedCapacityPresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_BATTERY_DESIGNED_CAPACITY_PRESENTATION_IND, nameSpace, description);
    return TRUE;
}

bool GattBatteryServerReadBatteryLowEnergyPresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_BATTERY_LOW_ENERGY_PRESENTATION_IND, nameSpace, description);
    return TRUE;
}

bool GattBatteryServerReadBatteryCriticalEnergyPresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_BATTERY_CRITICAL_ENERGY_PRESENTATION_IND, nameSpace, description);
    return TRUE;
}

bool GattBatteryServerReadNominalVoltagePresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_NOMINAL_VOLTAGE_PRESENTATION_IND, nameSpace, description);
    return TRUE;
}

/****************************************************************************/
bool GattBatteryServerReadManufacturerNameStringResponse(const GBASS* batteryServer, uint32 cid, uint8* manufacturerNameString)
{
    uint16 status = CSR_BT_GATT_ACCESS_RES_READ_NOT_PERMITTED;
    if (batteryServer == NULL)
    {
        manufacturerNameString = NULL;
        return FALSE;
    }
    status = CSR_BT_GATT_ACCESS_RES_SUCCESS;
    sendManufacturerNameStringAccessRsp(batteryServer, cid, manufacturerNameString, status);
    return TRUE;
}

bool GattBatteryServerReadManufacturerNameStringClientConfigResponse(const GBASS* batteryServer, uint32 cid, uint16 clientConfig)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryConfigAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_MANUFACTURER_NAME_STRING_CLIENT_CONFIG_IND, clientConfig);
    return TRUE;
}

bool GattBatteryServerReadManufacturerNameStringPresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_MANUFACTURER_NAME_STRING_PRESENTATION_IND, nameSpace, description);
    return TRUE;
}

/****************************************************************************/
bool GattBatteryServerReadModelNumberStringResponse(const GBASS* batteryServer, uint32 cid, uint8* modelNumberString)
{
    uint16 status = CSR_BT_GATT_ACCESS_RES_READ_NOT_PERMITTED;

    if (batteryServer == NULL)
    {
        modelNumberString = NULL;
        return FALSE;
    }
    status = CSR_BT_GATT_ACCESS_RES_SUCCESS;
    sendModelNumberStringAccessRsp(batteryServer, cid, modelNumberString, status);
    return TRUE;
}

bool GattBatteryServerReadModelNumberStringClientConfigResponse(const GBASS* batteryServer, uint32 cid, uint16 clientConfig)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryConfigAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_MODEL_NUMBER_STRING_CLIENT_CONFIG_IND, clientConfig);
    return TRUE;
}

bool GattBatteryServerReadModelNumberStringPresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_MODEL_NUMBER_STRING_PRESENTATION_IND, nameSpace, description);
    return TRUE;
}

/****************************************************************************/
bool GattBatteryServerReadSerialNumberResponse(const GBASS* batteryServer, uint32 cid, uint8* serial_number, uint16 size)
{
    uint16 status = CSR_BT_GATT_ACCESS_RES_READ_NOT_PERMITTED;

    if (batteryServer == NULL)
    {
        return FALSE;
    }
    if (serial_number != NULL)
    {
        status = CSR_BT_GATT_ACCESS_RES_SUCCESS;
    }
    else
    {
        status = CSR_BT_GATT_ACCESS_RES_INSUFFICIENT_RESOURCES;
    }
    sendBatterySerialNumberAccessRsp(batteryServer, cid, serial_number, size, status);

    return TRUE;
}

bool GattBatteryServerSerialNumberClientConfigResponse(const GBASS* batteryServer, uint32 cid, uint16 clientConfig)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryConfigAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_MODEL_NUMBER_STRING_CLIENT_CONFIG_IND, clientConfig);
    return TRUE;
}

bool GattBatteryServerReadSerialNumberPresentationResponse(const GBASS* batteryServer, uint32 cid, uint8 nameSpace, uint16 description)
{
    if (batteryServer == NULL)
    {
        return FALSE;
    }
    sendBatteryPresentationAccessRsp(batteryServer, cid, GATT_BATTERY_SERVER_READ_SERIAL_NUMBER_PRESENTATION_IND, nameSpace, description);
    return TRUE;
}

#endif /* EXCLUDE_GATT_BATTERY_SERVICE_V1P1 */

